- return unless can?(current_user, :admin_operations, @project)

- setting = error_tracking_setting

%section.settings.no-animate.js-error-tracking-settings
  .settings-header
    %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only
      = _('Error tracking')
    = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do
      = _('Expand')
    %p
      = _('Link Sentry to GitLab to discover and view the errors your application generates.')
      = link_to _('Learn more.'), help_page_path('operations/error_tracking'), target: '_blank', rel: 'noopener noreferrer'
  .settings-content
    .js-error-tracking-form{ data: { list_projects_endpoint: project_error_tracking_projects_path(@project, format: :json),
        operations_settings_endpoint: project_settings_operations_path(@project),
        project: error_tracking_setting_project_json,
        api_host: setting.api_host,
        enabled: setting.enabled.to_json,
        integrated: setting.integrated.to_json,
        gitlab_dsn: setting.gitlab_dsn,
        token: setting.token.present? ? '*' * 12 : nil } }
